home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
PIE-FLWO.ZIP
/
FLOGIN.PPS
< prev
next >
Wrap
Text File
|
1996-05-05
|
13KB
|
469 lines
; Fast Login Wizard v1.5
;
; Source code by Odin of Providence
; (C) Copyright 1996, Odin
; All Rights Reserved
;
; Compiled and working with PPLC 3.01
;
; Most of the code should be self-explaining.
; This code is here because you could learn
; something or just want to check out how I
; did this program. You can improve it or some-
; thing like that, but please don't put your
; name on it and spread or steal my routines.
;
; Oh! BTW I have used the String and Byte Variables a bit shitty, so It can
; be really hard to figure out what they do.
;$USEFUNCS
String cfgopts(05)
String c(1)
String options(8)
String cfg(45)
String token
String line
String tangent
String stemp
String datline
String txtch
String control
String q
Byte len
Byte i, a
Byte optnr
Byte temp, temp2, temp3
Declare Procedure drawprompt(String type)
Declare Procedure readcfg (String handle)
Declare Procedure getline (Byte temp, String line)
Declare Procedure highlight (Byte linje, Byte bar, Boolean choice)
Declare Procedure rw (Byte option)
Declare Procedure error ()
Declare Procedure about ()
Declare Procedure writeth ()
Declare Procedure login ()
Declare Procedure config ()
Begin
Let token=Len(U_NAME())
Let i=Len(U_NAME())
For a=1 To i
Let txtch=Left(U_NAME(), a)
Let txtch=Right(txtch, 1)
If (txtch="."|txtch=" ") Goto nexg
Let stemp=stemp+txtch
:nexg
Next a
If (i=>6) Let q=Left(stemp, 6) ; This is to avoid those annoying
If (i <6) Let q=Left(stemp, i) ; spaces in filename. For compabilty.
Let q=q+token
; Woha this algothrim gets a filename for every user, a SPECIAL one for
; every USER. No USER can never have the same FILENAME with this routine.
; ( I think, I'm not sure =) ). If the program detects a '.' it will skip
; it because dots doesn't work in DOS filenames! doh! =). Fuck those who
; use special chars like '.' and other! Use normal instead!!
If (!Exist(PPEPath()+"flogin.cfg")) error()
FOpen 1,PPEPath()+"flogin.cfg",O_RD,DEFS
For temp=0 To 4
FGet 1,cfgopts(temp)
Next temp
FGet 1,c(0)
For temp=0 To 8
FGet 1,options(temp)
Let optnr=temp
If (options(temp)="E-O-F") Break
Next temp
FClose 1
If (!(Exist(PPEPath()+"\DATA\"+q+".dat"))) Then
Let datline="E-O-F"
Goto nex
End If
readcfg(U_NAME())
; If the users line isn't found start this routine
:nex
If (datline="E-O-F") Then ; If the current user not is
If (Exist(PPEPath()+"\DATA\"+q+".dat")) Delete PPEPath()+"\DATA"+q+".dat"
FCreate 1,PPEPath()+"\DATA\"+q+".dat",O_WR,DEFS
Let token=U_NAME()+";YES;YES"
For i=0 To ((optnr*2)-1)
Let token=token+";1"
Next i
FPutLn 1,token
FClose 1
End If
getline(1,c(0))
Let c(1)=stemp
getline(2,c(0))
Let c(0)=stemp
;check if the datline is the "right" len (8chr+opts*2(*2))
readcfg(U_NAME())
Let len=Len(datline)
Let a=Len(U_NAME())
Let len=len-a
If (!(len=(8+((optnr*2)*2)))) Then
Cls
PrintLn "IT SEEMS LIKE *YOUR* DATA LINE IS INVALID...ERASING LINE."
PrintLn "GENERATING A DEFAULT LINE..."
PrintLn "PLEASE CHANGE TO YOUR OWN SETTINGS BY RUNING THE CFG PPE."
PrintLn
PrintLn "THIS ERROR OCCURED BECAUSE SOMETHING SYSOP DID, NOT YOU."
If (Exist(PPEPath()+"\DATA\"+q+".dat")) Delete PPEPath()+"\DATA\"+q+".dat"
FCreate 1,PPEPath()+"\DATA\"+q+".dat",O_WR,DEFS
Let token=U_NAME()+";YES;YES"
For i=0 To ((optnr*2)-1)
Let token=token+";1"
Next i
FPutLn 1,token
FClose 1
Delay 50
End If
; Maybe I could have done the lines above smarter...but I haven't time
; to do that! =) It works anyway, thats the main thing.
readcfg(U_NAME())
getline(2,datline)
Let cfg(0)=stemp
getline(3,datline)
Let cfg(1)=stemp
Let token=Upper(GetToken())
If (token="/CFG") Then
Cls
Print c(0)+"LOADING PLEASE WAIT ["
For i=0 To ((optnr*2)-1)
Print c(0)+"■"
Next i
Print c(0)+"]"
For i=0 To ((optnr*2)-1) ; get all the 0 and 1:s
AnsiPos 22+i,1 : Print c(1)+"■"
getline(4+i,datline) ; It starts on nr 4 (1;2;3;[4];5;6)
Let cfg(2+i)=stemp ; +2 because 1 and 2 is used
Next i
config()
End If
Cls
login()
End
Procedure login()
If (cfg(1)="NO ") Then
Let cfgopts(5)=cfg(0)
writeth()
End If
drawprompt(cfg(0))
Let cfgopts(5)=cfg(0)
:choices
Let tangent=""
:choices1
If (!(tangent="")) Goto check
Let tangent=Inkey()
Goto choices1
:check
If (((tangent="LEFT"|tangent="RIGHT"))&Upper(cfgopts(5))="YES") Then Let cfgopts(5)="NO "
Else If (((tangent="RIGHT"|tangent="LEFT"))&Upper(cfgopts(5))="NO ") Then Let cfgopts(5)="YES"
End If
If (tangent=CHR(13)&(Upper(cfgopts(5))="YES"|Upper(cfgopts(5))="NO ")) writeth()
drawprompt(cfgopts(5))
Goto choices
End Proc
Procedure writeth()
readcfg(U_NAME())
If (cfgopts(5)="YES") Then
For i=(optnr+4) To ((optnr*2)+3)
getline(i, datline) ; Output line: String stemp
If (stemp="1") rw(i-optnr-4) ; -4 and -optnr because 'i' starts on 0
Next i
End If
If (cfgopts(5)="NO ") Then
For i=4 To optnr+3
getline(i, datline) ; Output line: String stemp
If (stemp="1") rw(i-4) ; -4 because 'i' starts on 0
Next i
End If
End
End Proc
Procedure getline(Byte temp, String line)
Let len=Len(line)
Let control=0
Let stemp=""
For a=1 To len
Let txtch=Left(line, a)
Let txtch=Right(txtch, 1)
If (txtch=";") Then
Inc control
If (control=temp) Break
Let stemp=""
End If
If (!(txtch=";")) Let stemp=stemp+txtch
Next a
End Proc
Procedure rw(Byte option)
getline(2,options(option))
Let token=(Left(stemp,1)) ; let's reuse String token
Let len=Len(stemp) ; the next 3 Let takes away the first char
Let len=len-1
Let stemp=Right(stemp,len)
If (token="%") DispFile stemp,DEFS
If (token="!") Call stemp
End Proc
Procedure drawprompt(String type)
Cls : PrintLn : PrintLn
If (type="YES") PrintLn cfgopts(0)+" "+cfgopts(2)+" "+cfgopts(3)
If (type="NO ") PrintLn cfgopts(0)+" "+cfgopts(1)+" "+cfgopts(4)
End Proc
Procedure readcfg(String handle)
FOpen 1,PPEPath()+"\DATA\"+q+".dat",O_RD,DEFS
FGet 1,datline
FClose 1
getline(1,datline)
If (!(stemp=handle)) Let datline="E-O-F"
End Proc
Procedure config()
Cls
DispFile PPEPath()+"flogin.pcb",DEFS
For i=0 To 2
highlight(3, i, False)
highlight(0, i, False)
Next i
For i=0 To (optnr-1)
highlight(2, i, False)
highlight(1, i, False)
Next i
Let temp2=0
Let temp3=0
highlight(temp3, temp2, True)
:choices
Let tangent=""
:choices1
If (!(tangent="")) Goto check
Let tangent=Inkey()
Goto choices1
:check
If (tangent="UP"&temp3<3) Then
highlight(temp3, temp2, False)
Inc temp3
Let temp2=0
End If
If (tangent="DOWN"&temp3>0) Then
highlight(temp3, temp2, False)
Dec temp3
Let temp2=0
End If
If (((temp3=3&temp2<1)|(temp3=0&temp2<1))&tangent="RIGHT") Then
highlight(temp3, temp2, False)
Inc temp2
End If
If ((temp3=0|temp3=1|temp3=2|temp3=3)&tangent="LEFT"&temp2>0) Then
highlight(temp3, temp2, False)
Dec temp2
End If
If ((temp3=1|temp3=2)&tangent="RIGHT"&temp2<(optnr-1)) Then
highlight(temp3, temp2, False)
Inc temp2
End If
If (tangent=CHR(032)|tangent=CHR(013)) Then
If (temp3=0) Then
If (temp2=0) Then
Delete PPEPath()+"\DATA\"+q+".dat"
FCreate 1,PPEPath()+"\DATA\"+q+".dat",O_WR,DEFS
Let token=U_NAME()+";"+cfg(0)+";"+cfg(1)
For i=2 To ((optnr*2)+1)
Let token=token+";"+cfg(i)
Next i
FPutLn 1,token
FClose 1
Cls : End
End If
If (temp2=1) about()
End If
If (temp3=2) Then
If (cfg(temp2+2)="0") Then
Let cfg(temp2+2)="1"
AnsiPos 05,12+temp2 : Print c(0)+"[X]"
Else If (cfg(temp2+2)="1") Then
Let cfg(temp2+2)="0"
AnsiPos 05,12+temp2 : Print c(1)+"[ ]"
End If
End If
If (temp3=1) Then
If (cfg(optnr+temp2+2)="0") Then
Let cfg(optnr+temp2+2)="1"
AnsiPos 38,12+temp2 : Print c(0)+"[X]"
Else If (cfg(optnr+temp2+2)="1") Then
Let cfg(optnr+temp2+2)="0"
AnsiPos 38,12+temp2 : Print c(1)+"[ ]"
End If
End If
If (temp3=3) Then
If (temp2=0&cfg(0)="YES") Then Let cfg(0)="NO "
Else If (temp2=0) Then Let cfg(0)="YES" : End If
If (temp2=1&cfg(1)="YES") Then Let cfg(1)="NO "
Else If (temp2=1) Then Let cfg(1)="YES" : End If
End If
End If
highlight(temp3, temp2, True)
Goto choices
End Proc
Procedure highlight(Byte linje, Byte bar, Boolean choice)
If (bar=0&linje=3) Then
AnsiPos 05,09
If (choice=True) Print c(0)+"DEFAULT ALTERANTIVE: ["+c(1)+cfg(0)+c(0)+"]"
If (choice=False) Print c(0)+"DEFAULT ALTERANTIVE: ["+c(1)+Lower(cfg(0))+c(0)+"]"
End If
If (bar=1&linje=3) Then
AnsiPos 38,09
If (choice=True) Print c(0)+"USE FAST LOGIN PROMPT: ["+c(1)+cfg(1)+c(0)+"]"
If (choice=False) Print c(0)+"USE FAST LOGIN PROMPT: ["+c(1)+Lower(cfg(1))+c(0)+"]"
End If
If (bar=0&linje=0) Then
AnsiPos 05,21
If (choice=True) Print c(0)+"["+c(1)+"END PPE"+c(0)+"]"
If (choice=False) Print c(0)+"["+c(1)+"end ppe"+c(0)+"]"
End If
If (bar=1&linje=0) Then
AnsiPos 15,21
If (choice=True) Print c(0)+"["+c(1)+"ABOUT"+c(0)+"]"
If (choice=False) Print c(0)+"["+c(1)+"about"+c(0)+"]"
End If
If (linje=1|linje=2) Then
getline(1,options(bar))
If (linje=1) Then
AnsiPos 38,12+bar
If (choice=False) Then
If (cfg(optnr+bar+2)="0") Print c(0)+"[ ] "+stemp
If (cfg(optnr+bar+2)="1") Print c(0)+"[X] "+stemp
End If
If (choice=True) Then
If (cfg(optnr+bar+2)="0") Print c(1)+"[ ]"
If (cfg(optnr+bar+2)="1") Print c(1)+"[X]"
End If
End If
If (linje=2) Then
AnsiPos 05,12+bar
If (choice=False) Then
If (cfg(2+bar)="0") Print c(0)+"[ ] "+stemp
If (cfg(2+bar)="1") Print c(0)+"[X] "+stemp
End If
If (choice=True) Then
If (cfg(2+bar)="0") Print c(1)+"[ ]"
If (cfg(2+bar)="1") Print c(1)+"[X]"
End If
End If
End If
End Proc
Procedure about()
Cls
PrintLn c(0)+" █▀▀▀▓"
PrintLn " ▀ ▀ █▀▓▀▀▀▀▀█▄▄▓▄▄▄▄▄▄▓▀▀▀█▄▄▄▓ ░ ▀▓▀▀▀█▄"
PrintLn " ▄ ▓ ▄▄▓▄▓▄▄▄▄▄ ▀ ■▄▄▄▄▓ ▄■ ▄▄▄▓▄▄▄▄▓▄ ▀▀▀█▀ ▀ ▀"
PrintLn " ▄ ▓▄■ ▒ █▄██▓ ▐▄██▄ ░█████▌ █████ ██▓▄▓ u▓ ▄ ▄▓"
PrintLn " ░▒▓█▓█▓███▒█ ░ ▓████ █▓██▌ ███▓█ █▓███ ▐██▓█▌Z▒ █▒██▓█▒██▓▒░"
PrintLn " ░▒▓█▒████▓██ ■ ▐██▓██ █▄██▌ ▐█▓███ ▐█████ ▐██▄█▌!░ ███▓█████▓▒░"
PrintLn " ░▒▓████▓█▒█▓ ░ ▐█████ ██▓▀ ▐█▄███ ▐██▓██▄█▀▓█▀ ■ ▓████▓█▓█▓▒░"
PrintLn " ▐▀ ▓ ▒ █████■▄▀▀ ▒ ███▓█ █████ ▄▄▄▓▄ ░ ▐▀ ▀■"
PrintLn " ▓ ██▀▐█ ▄▓▄▄▓ ▄██▓█▓ ▀■███ ████▓ ▒"
PrintLn " "+c(1)+"1993"+c(0)+" █ ▓▀▓▀▀▀▀ █ ▀█ ▓▀▀▀▀▀▓ █▄▄ ▓▀▓▀▀▀▀ ▓ "+c(1)+"1996"+c(0)
PrintLn " █▄▄▄▄▄█▀▓▀▀ █▄▄▄█▀▓ ▒ ▓ ▀▐▄■▄▄▄▓▄█▀▓▀▀ ▀ ▀"
PrintLn " ▄ ▒ ▓ ░ ▒ ▒ ▀"
PrintLn " ░ ▓▄▄▄░ ▄"
PrintLn " 'LIVE AND KICKING SINCE 1993'"
PrintLn "┌─────────────────────────────────────────────────────────────────────────────┐"
PrintLn "│ [FAST LOGIN WIZARD v1.5a CODED BY "+c(1)+"ODIN"+c(0)+" OF "+c(1)+"PROVIDENCE "+c(0)+"IN DA NINETYNINETYSIX] │"
PrintLn "├─────────────────────────────────────────────────────────────────────────────┤"
PrintLn "│ [DO YOU WANT PURE QUALiTY? JUST CHECK OUT YOUR NEREAST BOARD FOR OUR PPE:s] │"
PrintLn "├─────────────────────────────────────────────────────────────────────────────┤"
PrintLn "│ WWW : "+c(1)+"http://infinity.beve.blacksburg.va.us/~odin/pie!.html "+c(0)+"(800x600x256) │"
PrintLn "│ E-MAIL: "+c(1)+"odin@infinity.beve.blacksburg.va.us "+c(0)+" THE IRC:"+c(1)+" #PIE on the EFNet"+c(0)+" │"
Print "└─────────────────────────────────────────────────────────────────────────────┘ "
Wait
config()
End Proc
Procedure error()
Cls
Print "CAN'T FIND 'FLOGIN.CFG'. PLEASE INFORM SYSOP. PPE DISABLED."
PrintLn : PrintLn
Wait
End
End Proc